# -*- coding: utf-8 -*-

import unittest

from core.utils import check_emso

from django.core.exceptions import ValidationError

class EmsoCheckTest(unittest.TestCase):
  def test_invalid(self):
    """Check if emso checker fails with invalid emso
    """
    self.assertRaises(ValidationError, check_emso, ['999999999999'])
  
  def test_birthdate_format(self):
    """Birthdate emso is valid
    """
    self.assertEqual(check_emso('0509197700000'), None)
  
  def test_valid(self):
    """A valid emso should go through
    """
    self.assertEqual(check_emso('0000000000000'), None)
